<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>WeFlow</title>
    <link rel="stylesheet" href="assets/css/reset.css">
    <link rel="stylesheet" href="assets/css/app.css">

    <script type="text/javascript">

        window.nodeRequire = require;
        delete window.require;
        delete window.exports;
        delete window.module;

        // Pretend that cookies work
        (function (document) {
            var cookies = {};
            document.__defineGetter__('cookie', function () {
                var output = [];
                for (var cookieName in cookies) {
                    output.push(cookieName + "=" + cookies[cookieName]);
                }
                return output.join(";");
            });
            document.__defineSetter__('cookie', function (s) {
                var indexOfSeparator = s.indexOf("=");
                var key = s.substr(0, indexOfSeparator);
                var value = s.substring(indexOfSeparator + 1);
                cookies[key] = value;
                return key + "=" + value;
            });
            document.clearCookies = function () {
                cookies = {};
            };

            originalLocation = document.location;
            // Pretend that we're hosted on an Internet Website
            document.__defineGetter__('location', function () {
                return {
                    href: 'http://weflow.app/',
                    protocol: 'http:',
                    host: 'weflow.app',
                    port: '',
                    pathname: '/',
                    search: '',
                    hash: '',
                    username: '',
                    password: '',
                    origin: 'http://weflow.app',
                    reload: function () {
                        return originalLocation.reload.apply(originalLocation, arguments);
                    }
                };
            });

            // Nobody sets location
            document.__defineSetter__('location', function () {
            })
        })(document);

        (function (i, s, o, g, r, a, m) {
            i['GoogleAnalyticsObject'] = r;
            i[r] = i[r] || function () {
                        (i[r].q = i[r].q || []).push(arguments)
                    }, i[r].l = 1 * new Date();
            a = s.createElement(o),
                    m = s.getElementsByTagName(o)[0];
            a.async = 1;
            a.src = g;
            m.parentNode.insertBefore(a, m)
        })(window, document, 'script', 'https://o4jiepyc4.qnssl.com/analytics.js', 'ga');
        // qiniu CDN for speeding up ga.js -> https://www.google-analytics.com/analytics.js

        // Get using version of WeFlow
        var version = nodeRequire('./package.json').version;

        ga('create', 'UA-24431632-7', 'auto');
        ga('set', 'checkProtocolTask', null); // Disable file protocol checking.
        ga('set', 'location', '/app.html'); // Allow file:// request for GA
        ga('set', 'dimension1', version);
        ga('send', 'event', 'Version', 'update', version);
        ga('send', 'pageview');

    </script>
</head>
<body>
<div class="wraper">
    <div class="welcome hide" id="js-welcome">
        <div class="logo"></div>
        <div class="title">WeFlow</div>
        <div class="subtitle">子在川上曰：逝者如斯夫，不舍昼夜。</div>
        <div class="welcome-example" id="js-example">导入示例项目</div>
        <div class="tips">
            <div class="icon-tips"></div>
            <div class="tips__content">添加一个空项目</div>
        </div>
    </div>
    <div class="projects">
        <div class="projects__header">
            Projects
        </div>
        <ul class="projects__list" id="js-project-list">

        </ul>
    </div>
    <div class="bottom-fixed">
        <div class="tasks" id="js-tasks">
            <span data-task="dev" id="js-build-dev" class="tasks__button">开发</span>
            <span data-task="dist" class="tasks__button">编译</span>
            <span data-task="ftp" class="tasks__button">上传</span>
            <span data-task="zip" class="tasks__button">打包</span>
        </div>
        <div class="logs" id="js-log">
            <span class="icon icon-clean" id="js-clean-log" title="清除日志"></span>
            <div class="logs__inner">

            </div>
        </div>
    </div>
    <div class="bottom-bar">
        <span class="icon icon-add" id="js-new-project" title="新建项目"></span>
        <span class="icon icon-del" id="js-del-project" title="删除项目"></span>
        <span class="icon icon-open" title="打开项目">
            <input class="bottom-bar__open" id="js-open-project" type="file" webkitdirectory multiple>
        </span>
        <span class="icon icon-setting" id="js-setting-button" title="全局设置"></span>
        <span class="icon icon-log" id="js-log-button" title="查看日志"></span>

        <span class="bottom-bar__status" id="js-logs-status"></span>
    </div>
</div>

<div class="setting hide" id="js-setting">
    <a href="javascript:;" id="js-setting-close" class="icon icon-close"></a>
    <a href="https://github.com/weixin/weflow" id="js-help" class="icon icon-help"></a>

    <div class="setting__section" id="js-workspace">
        <div class="setting__hd">工作区路径</div>
        <div class="setting__bd">
            <div class="ui-text">
                <input type="text" data-workspace="true" id="js-form-workspace" value="/Users/Apple/Workspace/Projects/">
            </div>
        </div>
    </div>

    <div class="setting__section">
        <div class="setting__hd">功能</div>
        <div class="setting__bd">
            <div class="ui-checkbox">
                <input type="checkbox" name="livereload" checked id="livereload">
                <label for="livereload">开启 LiveReload 浏览器自动刷新</label>
            </div>
            <div class="ui-checkbox">
                <input type="checkbox" name="supportREM" id="supportREM">
                <label for="supportREM">开启 REM 适配解决方案</label>
            </div>
            <div class="ui-checkbox">
                <input type="checkbox" name="supportWebp" id="supportWebp">
                <label for="supportWebp">开启 智能 WebP 解决方案</label>
            </div>
            <div class="ui-checkbox">
                <input type="checkbox" name="reversion" id="reversion">
                <label for="reversion">开启 文件版本 (MD5) 去缓存解决方案</label>
            </div>
            <div class="ui-checkbox">
                <input type="checkbox" name="supportChanged" id="supportChanged">
                <label for="supportChanged">开启 文件变动增量编译支持</label>
            </div>
            <div class="ui-checkbox">
                <input type="checkbox" name="SVGGracefulDegradation" id="SVGGracefulDegradation">
                <label for="SVGGracefulDegradation">开启 SVG 降级，兼容不支持 svg 的浏览器</label>
            </div>
        </div>
    </div>

    <div class="setting__section">
        <div class="setting__hd">设置</div>
        <div class="setting__bd">
            <label class="setting__subtitle">上传配置(默认为 FTP)</label>
            <div class="ui-text ui-text_short">
                <input type="text" name="ftp-host" placeholder="服务器地址" value="">
            </div>
            <div class="ui-checkbox sftp">
                <input type="checkbox" name="ftp-ssh" id="sftp">
                <label for="sftp">使用 SFTP</label>
            </div>
            <div class="ui-text ui-text_short">
                <input type="text" name="ftp-user" placeholder="用户名" value="">
            </div>
            <div class="ui-text ui-text_short">
                <input type="text" name="ftp-pass" placeholder="密码" value="">
            </div>
            <div class="ui-text ui-text_short">
                <input type="text" name="ftp-port" placeholder="端口" value="">
            </div>
            <div class="ui-text">
                <input type="text" name="ftp-remotePath" placeholder="远程路径" value="">
            </div>
            <div class="ui-checkbox">
                <input type="checkbox" name="ftp-includeHtml" id="ftp-includeHtml">
                <label for="ftp-includeHtml">上传文件包含 .html 文件类型</label>
            </div>
        </div>
    </div>

    <div class="setting__del hide" id="js-del-project-btn">
        删除此项目
    </div>
</div>

<div class="about hide" id="js-about">
    <div class="logo"></div>
    <div class="title">WeFlow</div>
    <div class="version">Version 1.0.0</div>
    <div class="desc">一个基于 <a href="https://github.com/weixin/tmt-workflow">tmt-workflow</a> 的前端工作流程序</div>

    <div class="about__buttom">
        <div class="about__buttom-info">本 App 所有代码和设计稿均已开源</div>
        <div class="about__buttom-list">
            <a href="javascript:;" class="about__buttom-list-item">GitHub</a>
            <a href="javascript:;" class="about__buttom-list-item">Dribbble</a>
            <a href="javascript:;" class="about__buttom-list-item">官 网</a>
        </div>
    </div>

    <a href="javascript:;" class="icon icon-close"></a>

</div>


<script src="./assets/js/jquery.min.js"></script>
<script src="./src/app.js"></script>
<script src="./src/menu.js"></script>
<script type="text/javascript" src="http://pingjs.qq.com/h5/stats.js" name="MTAH5" sid="500140708"></script>
</body>
</html>
